]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
data: Use ConditionEnvironment on unit files
authorJoan Torres <joan.torres@suse.com>
Wed, 7 Jun 2023 07:59:25 +0000 (09:59 +0200)
committerJoan Torres <joan.torres@suse.com>
Wed, 7 Jun 2023 07:59:25 +0000 (09:59 +0200)
Following GNOME/gnome-shell!1472. It's been almost three years since
ConditionEnvironment was available.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2791>

data/org.gnome.Shell@wayland.service.in
data/org.gnome.Shell@x11.service.in

index 76d5ccb1b4e93d8f2630d00d1c86b83ebf4193b4..a1980e8a5602af1f846697d161399f48d2420159 100644 (file)
@@ -13,14 +13,12 @@ Requisite=gnome-session-initialized.target
 PartOf=gnome-session-initialized.target
 Before=gnome-session-initialized.target
 
+#NOTE: ConditionEnvironment works with systemd >= 246
+ConditionEnvironment=XDG_SESSION_TYPE=%I
+
 [Service]
 Slice=session.slice
 Type=notify
-# NOTE: This can be replaced with ConditionEnvironment=XDG_SESSION_TYPE=%I in
-#       the [Unit] section with systemd >= 246. Also, the current solution is
-#       kind of painful as systemd had a bug where it retries the condition.
-# Only start if the template instance matches the session type.
-ExecCondition=/bin/sh -c 'test "$XDG_SESSION_TYPE" = "%I" || exit 2'
 ExecStart=@bindir@/gnome-shell
 # Exit code 1 means we are probably *not* dealing with an extension failure
 SuccessExitStatus=1
index 078d87a3c93e5c2b5d7d537a48cdffc56d83ae70..e5785b4539dbcbf2c7ed8db330b6b5c3bc78c19d 100644 (file)
@@ -13,6 +13,9 @@ Requisite=gnome-session-initialized.target
 PartOf=gnome-session-initialized.target
 Before=gnome-session-initialized.target
 
+#NOTE: ConditionEnvironment works with systemd >= 246
+ConditionEnvironment=XDG_SESSION_TYPE=%I
+
 # Limit startup frequency more than the default
 StartLimitIntervalSec=15s
 StartLimitBurst=3
@@ -20,11 +23,6 @@ StartLimitBurst=3
 [Service]
 Slice=session.slice
 Type=notify
-# NOTE: This can be replaced with ConditionEnvironment=XDG_SESSION_TYPE=%I in
-#       the [Unit] section with systemd >= 246. Also, the current solution is
-#       kind of painful as systemd had a bug where it retries the condition.
-# Only start if the template instance matches the session type.
-ExecCondition=/bin/sh -c 'test "$XDG_SESSION_TYPE" = "%I" || exit 2'
 ExecStart=@bindir@/gnome-shell
 # Exit code 1 means we are probably *not* dealing with an extension failure
 SuccessExitStatus=1